<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body> 
<script type="text/javascript"
		src="static/bootstrap/js/jquery-3.4.1.min.js"></script>
	<script type="text/javascript">
		$(function() {
			//发异步请求
			$.ajax({
				url:'good',
				data:{
					action:'selectItem',
					id:0
				},
				type:'get',
				dataType:'json',
				success:function(res) {
					for(var i = 0;i<res.length;i++) {
						//console.log(res[i].cname + "==" + res[i].cid);
						$("#sel").append("<option value='"+res[i].gid+"'>"+res[i].gname+"</option>");
					}
				}
			})
		})
	</script>
<form action="goods" method="post" enctype="multipart/form-data" >

                         编号：<input type="text" value="${goods.getGid()}" name="gid" readonly="readonly"/><br>
			商品名称：<input type="text" value="${goods.getGname()}" name="gname" /><br>
			生产日期：<input type="date" value="${goods.getPub()}" name="pubdate" /><br> 
			图片：<input type="text" value="${goods.getPic()}" name="pic" /><br>
			 单价：<input type="text" value="${goods.getPrice()}" name="price" /><br>
		        评分：<input type="text" value="${goods.getStar()}" name="star" /><br>
			备注：<input type="text" value="${goods.getInfo()}" name="info" /><br>
			<hr>
			类别：<select id="sel" name="sel">
			   
			</select>
			<hr> 
			<%-- 类别：<input type="text" value="${goods.getTypeid()}" name="typeid" /><br> --%>
			<input type="submit" value="确认修改" />
</form>
</body>
</html>